﻿using FreeSql.DataAnnotations;
using System.ComponentModel;

namespace D.Wx.Entities
{
    /// <summary>
    /// 基类
    /// </summary>
    public class BaseEntity
    {
        public BaseEntity()
        {
            this.DeleteFlag = false;
            this.CreateTime = DateTime.Now;
            this.Id = Guid.NewGuid().ToString();
        }

        /// <summary>
        ///主键
        /// </summary>
        [Column(IsPrimary = true, DbType = "varchar", StringLength = 64)]
        [Description("主键")]
        public string? Id { get; set; }

        /// <summary>
        /// 创建人
        /// </summary>
        [Column(DbType = "varchar", StringLength = 64)]
        [Description("创建人")]
        public string? CreateUser { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        [Column(DbType = "datetime")]
        [Description("创建时间")]
        public DateTime CreateTime { get; set; }

        /// <summary>
        /// 修改人
        /// </summary>
        [Column(IsNullable = true, DbType = "varchar", StringLength = 64)]
        [Description("修改人")]
        public string? UpdateUser { get; set; }

        /// <summary>
        /// 修改时间
        /// </summary>
        [Column(DbType = "datetime")]
        [Description("修改时间")]
        public DateTime? UpdateTime { get; set; }

        /// <summary>
        /// 是否删除
        /// </summary>
        [Column(DbType = "bit")]
        [Description("是否删除")]
        public bool DeleteFlag { get; set; }
    }
}
